﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

namespace MLY.ADMIN
{
    public partial class Users : Bll.BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                
            }
        }

        protected void btnDelete_Click(object sender, ImageClickEventArgs e)
        {
            Bll.clsUser user = new MLY.Bll.clsUser();
            if (!user.DeleteUser(int.Parse(((ImageButton)sender).CommandArgument)))
            {
                string errorMessage = "Cannot Delete Your Own Entry !!!";
                //TODO exeption : cant delete yourself
                Response.Write("<script language='javascript'>alert('" + errorMessage + "');</script>");
            }
            else
            {
                GridView1.DataBind();

            }
        }

       
    }
}
